<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Sakura.Games.StgFramework.Builder.UI">

	<Style TargetType="{x:Type local:EditableListBox}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:EditableListBox}">
					<Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style TargetType="{x:Type local:EditableListBoxItem}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type local:EditableListBoxItem}">
					<Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
						<ContentPresenter Name="Content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="State" Value="Edit">
							<Setter TargetName="Content" Property="ContentTemplate" Value="{TemplateBinding EditContentTemplate}" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="State" Value="Edit" />
								<Condition Property="EditContentTemplate" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter TargetName="Content" Property="ContentTemplate" Value="{TemplateBinding ContentTemplate}" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="State" Value="New" />
								<Condition Property="NewContentTemplate" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter TargetName="Content" Property="ContentTemplate" Value="{TemplateBinding EditContentTemplate}" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="State" Value="New" />
								<Condition Property="NewContentTemplate" Value="{x:Null}" />
								<Condition Property="EditContentTemplate" Value="{x:Null}" />
							</MultiTrigger.Conditions>
							<Setter TargetName="Content" Property="ContentTemplate" Value="{TemplateBinding ContentTemplate}" />
						</MultiTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>
